<template>
  <div id="menuList">
    <el-menu :default-active="activeIndex" class="el-menu-demo" mode="horizontal" @select="handleSelect">
      <el-menu-item index="1">首页</el-menu-item>
      <el-submenu index="2">
        <template slot="title">商品分类</template>
        <el-menu-item index="2-1">蔬菜蛋品</el-menu-item>
        <el-menu-item index="2-2">蔬菜</el-menu-item>
        <el-menu-item index="2-3">海鲜水产</el-menu-item>
        <el-submenu index="2-4">
          <template slot="title">新鲜水果</template>
          <el-menu-item index="2-4-1">时令水果</el-menu-item>
          <el-menu-item index="2-4-2">热带水果</el-menu-item>
        </el-submenu>
      </el-submenu>
      <el-menu-item index="3" disabled>移动端</el-menu-item>
    </el-menu>
  </div>
</template>

<script>
export default {
  name: 'menuList',
  data () {
    return {
      msg: 'menuList ',

      activeIndex: '1',
      activeIndex2: '1'
    }
  },
  methods: {
    handleSelect(key, keyPath) {
      console.log(key, keyPath);
    }
  }
}
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style >

</style>
